<div id="content">
    <?php if($baitap) : ?>
    <input type="hidden" id="mabt" value="<?php echo $mabaitap; ?>">
    <div class="danhsachgopy">Bài Tập: <?php echo $tenbaitap; ?></div>
    <form>
        <div id="thoigian" class="thoigian">Thời gian còn lại<div class="cangiua">60:00 phút</div></div>
        <div class="block" style="padding: 20px;">
            <table class="table table-bordered">
            <?php foreach ($baitap as $value) : ?>
                <tr>
                    <td style="background-color: #d9edf7;font-weight: bold;">Câu <?php echo $value->cau.": ".$value->noidung; ?></td>
                </tr>
                <tr>
                    <td><input type="radio" disabled name="cau<?php echo $value->cau; ?>" value="<?php echo $value->a; ?>" 
                        <?php if($value->traloi==$value->a) echo "checked"; ?>
                        style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>a"><label for="cau<?php echo $value->cau; ?>a">a. <?php echo $value->a; ?></label></td>
                </tr>
                <tr>
                    <td><input type="radio" disabled name="cau<?php echo $value->cau; ?>" value="<?php echo $value->b; ?>" 
                        <?php if($value->traloi==$value->b) echo "checked"; ?>
                        style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>b"><label for="cau<?php echo $value->cau; ?>b">b. <?php echo $value->b; ?></label></td>
                </tr>
                <tr>
                    <td><input type="radio" disabled name="cau<?php echo $value->cau; ?>" value="<?php echo $value->c; ?>" 
                        <?php if($value->traloi==$value->c) echo "checked"; ?>
                        style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>c"><label for="cau<?php echo $value->cau; ?>c">c. <?php echo $value->c; ?></label></td>
                </tr>
                <tr>
                    <td><input type="radio" disabled name="cau<?php echo $value->cau; ?>" value="<?php echo $value->d; ?>" 
                        <?php if($value->traloi==$value->d) echo "checked"; ?>
                        style="margin-right: 10px;" required id="cau<?php echo $value->cau; ?>d"><label for="cau<?php echo $value->cau; ?>d">d. <?php echo $value->d; ?></label></td>
                </tr>
                <tr>
                    <td><?php if($value->traloi==$value->dapan) echo "Đúng!"; else echo "Sai! Đáp án đúng là: $value->dapan"; ?></td>
                </tr>
            <?php endforeach; ?>
            </table>
        </div>
    </form>
    
    <?php else : ?>
    <h4>Bài làm không tồn tại hoặc đã bị xóa!!!</h4>
    <?php endif; ?>
</div>